<!--修改名称弹框-->
<template>
    <div>
        <el-dialog
            title="编辑标题"
            :visible.sync="dialogVisible"
            width="30%">
            <el-input type="textarea" v-model="upName"></el-input>
            <span slot="footer" class="dialog-footer">
                <el-button @click="dialogVisible = false" size="mini">取 消</el-button>
                <el-button type="primary" @click="changeUnitName" size="mini">确 定</el-button>
            </span>
        </el-dialog>
    </div>
</template>

<script>
    export default {
        name: 'EditNameDialog',
        data () {
            return {
                dialogVisible: false,
                upName: null,
                unitId: null
            }
        },
        methods: {
             openEditName (item) {
                 this.dialogVisible = true
                 this.upName = item.titleId
                 this.unitId = item.unitId
             },
            changeUnitName () {
                let param = {
                    upName: this.upName,
                    unitId: this.unitId
                }
                this.$emit('changeUnitName', param)
                this.dialogVisible = false
                this.upName = null
                this.unitId = null
            }
        }
    }
</script>

<style scoped>

</style>
